package com.bsb.biz.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.bsb.base.mapper.InviteMapper;
import com.bsb.base.model.BsbCardBuyExample;
import com.bsb.base.model.BsbFirmExample;
import com.bsb.base.model.BsbUserExample;
import com.bsb.base.model.CardBuy;
import com.bsb.base.model.Invite;
import com.bsb.base.model.UserFirm;

@Service
public class InviteService {
	@Resource
	private InviteMapper inviteMapper;

	public int getCountInvite(String firmname, String supername, BsbUserExample bsbUserExample) {
		return inviteMapper.getCountInvite(firmname,supername,bsbUserExample);
	}

	public List<Invite> getInvites(String firmname, String supername, BsbUserExample bsbUserExample) {
		return inviteMapper.getInvites(firmname,supername,bsbUserExample);
	}
	
	public int secondInviteNum(String inviteBy){
		return inviteMapper.secondInviteNum(inviteBy);
	}
	
	public int fstCardBuyNum(String inviteBy){
		return inviteMapper.fstCardBuyNum(inviteBy);
	}
	public int secondCardBuyNum(String inviteBy){
		return inviteMapper.secondCardBuyNum(inviteBy);
	}
	
	public Double totalMoney(String inviteBy){
		return inviteMapper.totalMoney(inviteBy);
	}
/**
 * 一级邀请人个数
 * @param bsbUserExample
 * @param firmExample
 * @return
 */
	public int countFstInvites(BsbUserExample bsbUserExample, BsbFirmExample firmExample) {
		return inviteMapper.countFstInvites(bsbUserExample,firmExample);
	}
/**
 * 一级邀请人列表
 * @param bsbUserExample
 * @param firmExample
 * @return
 */
	public List<UserFirm> getFstInvites(BsbUserExample bsbUserExample, BsbFirmExample firmExample) {
		return inviteMapper.getFstInvites(bsbUserExample,firmExample);
	}
	/**
	 * 二级邀请
	 * @param bsbUserExample
	 * @param firmExample
	 * @param bsbUserExample2
	 * @return
	 */
	public int count2ndInvites(BsbUserExample bsbUserExample, BsbFirmExample firmExample,String supername) {
		return inviteMapper.count2ndInvites(bsbUserExample,firmExample, supername);
	}
	public List<Invite> get2ndInvites(BsbUserExample bsbUserExample, BsbFirmExample firmExample,String supername) {
		return inviteMapper.get2ndInvites(bsbUserExample,firmExample, supername);
	}
	
	public int count1stCardBuy(BsbUserExample bsbUserExample, BsbFirmExample firmExample,BsbCardBuyExample cardBuyExample) {
		return inviteMapper.count1stCardBuy(bsbUserExample,firmExample, cardBuyExample);
	}
	public List<CardBuy> get1stCardBuy(BsbUserExample bsbUserExample, BsbFirmExample firmExample,BsbCardBuyExample cardBuyExample) {
		return inviteMapper.get1stCardBuy(bsbUserExample,firmExample, cardBuyExample);
	}
	
	public int count2ndCardBuy(BsbUserExample bsbUserExample, BsbFirmExample firmExample,BsbCardBuyExample cardBuyExample,String inviteby) {
		return inviteMapper.count2ndCardBuy(bsbUserExample,firmExample, cardBuyExample,inviteby);
	}
	public List<CardBuy> get2ndCardBuy(BsbUserExample bsbUserExample, BsbFirmExample firmExample,BsbCardBuyExample cardBuyExample,String inviteby) {
		return inviteMapper.get2ndCardBuy(bsbUserExample,firmExample, cardBuyExample,inviteby);
	}
	
}
